package com.source.hotelbath.fragment;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.source.hotelbath.R;
import com.source.hotelbath.base.BaseDialog;
import com.source.hotelbath.weight.PickerView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ZhouMeng on 2017/9/24.
 */

public class HotelSelectDialog extends BaseDialog implements View.OnClickListener{

    public final static String TAG = HotelSelectDialog.class.getSimpleName();

   private List<String> mDatas;
    private  DlgListener mListener;

    public interface DlgListener {
        public void camera();

        public void gallery();

    }

    public HotelSelectDialog(Context context) {
        super(context, R.style.bottom_animation_dlg,true, Position.BOTTOM);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hotel_select);
        setCancelable(true);

        initView();
    }

    public void initView() {

        PickerView pickerView = (PickerView) findViewById(R.id.pv_hotel);
        TextView  bt_queding = (TextView)findViewById(R.id.bt_queding);
//        rl_date = (RelativeLayout) view.findViewById(R.id.rl_date);
        mDatas=new ArrayList<>();
        for (int i = 1; i < 60; i++) {
            mDatas.add(""+i);
        }
        pickerView.setData(mDatas);
//        pickerView.setSelected(MainActivity.num-1);
        pickerView.setOnSelectListener(new PickerView.onSelectListener() {
            @Override
            public void onSelect(String text, int mCurrentSelected) {
//                hotel = text;
            }
        });
    }



    @Override
    public void onClick(View view) {
        int id = view.getId();
//        if (id == R.id.tv_camera) {
//            if (null != mListener) {
//                mListener.camera();
//            }
//            dismiss();
//
//        } else if (id == R.id.tv_gallery) {
//            if (null != mListener) {
//                mListener.gallery();
//            }
//            dismiss();
//
//        } else if (id == R.id.tv_cancel) {
//            dismiss();
//
//        }
    }

    public  void registerListener(DlgListener listener) {
        mListener = listener;
    }
}
